package net.huashitong.user.web;

import java.util.HashMap;
import java.util.Map;

import net.huashitong.user.filter.ApkVersionFilter;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sirdc.modules.core.web.JsonBaseController;
import com.sirdc.modules.core.web.model.Message;

@Controller
@RequestMapping("/app/apkVersion")
public class ApkVersionController extends JsonBaseController {

	private static final String URL = "http://202.109.255.156:8131/files_pub/apk/xiamen-data.apk";
	@Override
	protected String getView(String arg0) {
		// TODO Auto-generated method stub
		return null;
	}
	/**
	 * 版本号控制
	 * @param
	 * @return
	 */
	@ResponseBody
	@RequestMapping("/detailApkVersion")
	public Message detailApkVersion(@RequestBody ApkVersionFilter filter){
		if("53".equals(filter.getApkVersion())){
			return coverMessage("500", "无需更新");
		}
		Map<String, Object> map = new HashMap<String, Object>();
//		StringBuffer str = new StringBuffer();
//		str.append("1.sifjoas\n");
//		str.append("2.sdjfoiasj\n");
		map.put("url", URL);
//		map.put("string","更新内容：\\n1、修复部分手机首页字体重叠问题。\\n2、修复新增帐号无法获取数据问题。");
		return coverMessage("200", "更新内容：\\n1、修复部分手机首页字体重叠问题。\\n2、修复新增帐号无法获取数据问题。", map);
	}
}
